package com.ruoyi.hr.controller.hr.empInfo;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.hr.domain.Authority;
import com.ruoyi.hr.service.AuthorityService;
import com.ruoyi.hr.service.empinfo.OftenQueryService;
import com.ruoyi.hr.service.empinfo.RemindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author zeo
 * @explain 常用提醒
 * @date 2020/4/9
 */
@Controller
@RequestMapping("empInfo/Remind")
public class RemindController extends BaseController {

    @Autowired
    RemindService remindService;

    @Autowired
    AuthorityService authorityService;

    private String prefix = "hr/empinfo/remind";


    /**
     * 跳转合同未签订页面
     */
    @GetMapping("contractNotSigned")
    public String contractNotSigned() {
        return prefix + "/contractNotSigned";
    }

    /**
     * 合同未签订数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/contractNotSignedList")
    @ResponseBody
    public TableDataInfo contractNotSignedList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.contractNotSignedList(map, authority));
    }

    /**
     * 跳转合同将到期
     */
    @GetMapping("contractWillExpire")
    public String contractWillExpire() {
        return prefix + "/contractWillExpire";
    }

    /**
     * 合同将到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/contractWillExpireList")
    @ResponseBody
    public TableDataInfo contractWillExpire(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.contractWillExpireList(map, authority));
    }


    /**
     * 跳转已到期
     */
    @GetMapping("contractExpired")
    public String contractExpired() {
        return prefix + "/contractExpired";
    }

    /**
     * 已到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/contractExpiredList")
    @ResponseBody
    public TableDataInfo contractExpiredList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.contractExpiredList(map, authority));
    }

    /**
     * 跳转需签无固定期限合同
     */
    @GetMapping("contractUrgent")
    public String contractUrgent() {
        return prefix + "/contractUrgent";
    }

    /**
     * 需签无固定期限合同数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/contractUrgentList")
    @ResponseBody
    public TableDataInfo contractUrgentList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.contractUrgentList(map, authority));
    }

    /**
     * 跳转试用将到期
     */
    @GetMapping("trialWillExpire")
    public String trialWillExpire() {
        return prefix + "/trialWillExpire";
    }

    /**
     * 试用将到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/trialWillExpireList")
    @ResponseBody
    public TableDataInfo trialWillExpireList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.trialWillExpiretList(map, authority));
    }

    /**
     * 跳转试用已到期
     */
    @GetMapping("trialExpired")
    public String trialExpired() {
        return prefix + "/trialExpired";
    }

    /**
     * 试用已到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/trialExpiredList")
    @ResponseBody
    public TableDataInfo trialExpiredList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.trialExpiredList(map, authority));
    }

    /**
     * 跳转实习将到期
     */
    @GetMapping("internshipWillExpire")
    public String internshipWillExpire() {
        return prefix + "/internshipWillExpire";
    }

    /**
     * 实习将到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/internshipWillExpireList")
    @ResponseBody
    public TableDataInfo internshipWillExpireList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.internshipWillExpireList(map, authority));
    }


    /**
     * 跳转实习已过期
     */
    @GetMapping("internshipExpire")
    public String internshipExpire() {
        return prefix + "/internshipExpire";
    }

    /**
     * 实习已过期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/internshipExpireList")
    @ResponseBody
    public TableDataInfo internshipExpireList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.internshipExpireList(map, authority));
    }

    /**
     * 跳转证件将到期
     */
    @GetMapping("certificatesWillExpire")
    public String certificatesWillExpire() {
        return prefix + "/certificatesWillExpire";
    }

    /**
     * 证件将到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/certificatesWillExpireList")
    @ResponseBody
    public TableDataInfo certificatesWillExpireList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.certificatesWillExpireList(map, authority));
    }


    /**
     * 跳转证件已到期
     */
    @GetMapping("certificatesExpire")
    public String certificatesExpire() {
        return prefix + "/certificatesExpire";
    }

    /**
     * 证件证件已到期数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/certificatesExpireList")
    @ResponseBody
    public TableDataInfo certificatesExpireList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.certificatesExpireList(map, authority));
    }


    /**
     * 今日生日
     */
    @GetMapping("todayBirthday")
    public String todayBirthday() {
        return prefix + "/todayBirthday";
    }

    /**
     * 今日生日数据
     *
     * @param map
     * @return
     */
    @RequestMapping("/todayBirthdayList")
    @ResponseBody
    public TableDataInfo todayBirthdayList(@RequestParam Map map) {
        Authority authority = authorityService.findAuthorAndIsAdmin();
        startPage();
        return getDataTable(remindService.todayBirthdayList(map, authority));
    }
}
